<extend name="./app/Tpl/Public/template.html" />
<block name="content_body">
	<div class="pad-lr-10">
		<form name="form_search" id="form_search" action="{:U('index')}" method="post">
		    <table width="100%" cellspacing="0" class="search-form">
		        <tbody>
		            <tr>
			            <td>
				            <div class="explain-col">
								<input type="text" name="title" value="{$search.title}" placeholder="广告关键字">
								<select name="page_id" style="width:150px;" class="chosen_search">
									<option value="">--类型--</option>
									<volist name="typeList.pc" id="val">
	                					<option value="{$key}" <if condition="$search['page_id'] eq $key">selected</if>>{$val}</option>
	                				</volist>
	                				<volist name="typeList.mobile" id="val">
	                					<option value="{$key}" <if condition="$search['page_id'] eq $key">selected</if>>{$val}</option>
	                				</volist>
								</select>
								<input type="button"  name="form_search_btn_search"  value="查询" onclick="document.forms['form_search'].submit()"/>
								<input type="button"  name="form_search_btn_add"  value="新增广告" onclick='redirect("{:U('showAdd')}")'/>
								<input type="button"  name="form_search_btn_add"  value="生成缓存" onclick='redirect("{:U('doAddCache')}")'/>
				        	</div>
			            </td>
		            </tr>
		        </tbody>
		    </table>
	    </form>
	    <form  name="form_list" id="form_list" action="{:U('index')}" method="post">
		    <div class="table-list">		
			    <table width="100%" cellspacing="0">
			        <thead>
			            <tr>
			            	<th width="150" align="center">类型</th> 
			            	<th width="200" align="left">图片</th>
			            	<th width="150" align="left">引用参数</th>
			            	<th width="40" align="left">显示</th>
			            	<th width="40" align="left">排序</th>
			      			<th align="left">操作</th>
			            </tr>
			        </thead>
			    	<tbody>
						<volist name="list" id='val'>
				        <tr>
				        	<td align="center">{$val.page_name}</td>
				        	<td align="left"><img src="{$val.pic}?{$Think.now} " width=100  height=30></td>
				        	<td align="left">{$val.page_ref}</td>
				            <td align="left" onclick="isShow('{:U('isShow')}','{$val.id}','is_show')" id="is_show_{$val.id}"><img src="__ROOT__/statics/images/is_show_{$val.is_show}.png" /></td>
				            <td align="left">
				            	<input type="text" class="input-text-c input-text" value="{$val.ordlist}" size="4" name="ordlist[{$val.id}]" id="ordlist_{$val.id}" onblur="ordlist('{:U('ordlist')}',{$val.id},'ordlist',this.value)"  onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
								<span id="ordlist_upd_{$val.id}" value="{$val.ordlist}"></span>
							</td>
				            <td align="left" class="btn">
			            		<a class="link_btn" href="#" onclick="redirect('{:U('showUpd',array('id'=>$val['id']))}')" >编辑</a>
				            </td>
				        </tr>
				        </volist>
			    	</tbody>
			    </table>
	    	</div>
	    </form>
	</div>
	<div id="dialog_content" title="弹出框"></div>
<script type="text/javascript">

$(function(){
	$( "#dialog_content" ).dialog({
		autoOpen: false,
		width:550,
		height:250
	});
})

</script>
</block>